package com.yanqu.road.server.cmd.bag;

import com.yanqu.road.pb.bag.BagProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.player.BagModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = GameProtocol.S_BAG_CHECK_NUM,desc = "检测")
public class CheckBagNum extends AbstractCommand {
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        BagProto.CheckBagNumReqMsg reqMsg = BagProto.CheckBagNumReqMsg.parseFrom(packet.getBytes());
        int goodsId = reqMsg.getGoodsId();
        player.getModule(BagModule.class).syncBagItem(goodsId);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
